package cn.bocweb.spinning.view.activity;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import butterknife.Bind;
import butterknife.ButterKnife;
import cn.bocweb.spinning.R;
import cn.bocweb.spinning.util.Constant;
import cn.bocweb.spinning.view.common.BaseActivity;

public class GuideActivity extends BaseActivity implements View.OnClickListener {

    @Bind(R.id.btn_guide)
    Button btnGuide;
    boolean isFirst = true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_guide);
        ButterKnife.bind(this);
        initClickBtn();
    }

    private void initClickBtn() {
        btnGuide.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent(this, SetQuesWarehouseActivity.class);
        intent.putExtra(Constant.SET_QUES_WAREHOUSE, Constant.FIRST_OPEN_APP_TO_WAREHOUSE);
//        SharedPreferences sp = getSharedPreferences(Constant.IS_FIRST_OPEN, Context.MODE_PRIVATE);
//        isFirst = sp.getBoolean(Constant.KEY_FIRST_OPEN, true);
//
//        if (isFirst) {
//            SharedPreferences.Editor editor = sp.edit();
//            editor.putBoolean(Constant.KEY_FIRST_OPEN, false);
//            editor.apply();
//        }
        startActivity(intent);
        finish();
    }
}
